package com.kcyu.sfherp.mapper.ck;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kcyu.sfherp.entity.CkSale;
import com.kcyu.sfherp.entity.CkStock;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CkSaleMapper extends BaseMapper<CkSale> {

    @Select("SELECT * FROM Sale WHERE Dte >= N'${startTime} 00:00:00' AND Dte <= N'${endTime} 23:59:59' ORDER BY [Dte] DESC")
    public List<CkSale> queryByTime(@Param("startTime") String startTime, @Param("endTime") String endTime);

    @Select("SELECT * FROM Pur WHERE Dte >= N'${startTime} 00:00:00' AND Dte <= N'${endTime} 23:59:59' ORDER BY [Dte] DESC")
    public List<CkSale> queryPurByTime(@Param("startTime") String startTime, @Param("endTime") String endTime);
}

